package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.item.client.ItemFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/*
 *
 * 商品详情页  渲染*/

@Controller
public class ItemController {

    @Autowired
    private ItemFeignClient itemFeignClient;

    // 商品详情页  渲染开始了
    @GetMapping("/{skuId}.html")
    public String itemPage(@PathVariable Long skuId, Map map){

        Map<String, Object> result = itemFeignClient.getItem(skuId);
        map.putAll(result);
       /* map.put("");
        map.put("");*/
        return "item/index";
    }
}
